Skip to content

Fix CI: ruff, black, and stale VehicleStatus tests#24

Merged
bjhiltbrand merged 1 commit into
bjhiltbrand:masterfrom
magikh0e:fix-ci
Jun 6, 2026
Merged

Fix CI: ruff, black, and stale VehicleStatus tests#24
bjhiltbrand merged 1 commit into
bjhiltbrand:masterfrom
magikh0e:fix-ci

Conversation

@magikh0e

@magikh0e magikh0e commented Jun 6, 2026

Copy link
Copy Markdown
Contributor

What

The test workflow began running on master after #22, which exposed three failures (now all green):

  • ruff UP031: cognito_timestamp() used "..." % (...); switched to an f-string with identical output.
  • black: reformatted device_srp.py, auth.py, client.py and the device tests. client.py was never black-compliant, CI just never ran black on master before now.
  • pytest: test_from_dict_full and test_get_vehicle_status_success fed a flat dict (is_running, battery_percent, ...) that VehicleStatus.from_dict never reads, it parses the nested last_known_state.controller. Both were already failing. Rewrote them to the real payload shape and assert the values the model actually produces.

Verification

Locally: ruff check drone_mobile/, black --check drone_mobile/ tests/, and pytest (79 passed) all pass.

The test workflow started running on master (bjhiltbrand#22) and surfaced three
failures:

- ruff UP031: cognito_timestamp used percent formatting; switched to an
  f-string with identical output.
- black: reformatted device_srp.py, auth.py, client.py and the device
  tests to satisfy black --check (client.py was never black-compliant;
  CI just never ran black on master before).
- pytest: test_from_dict_full and test_get_vehicle_status_success fed a
  flat dict the model never reads (VehicleStatus.from_dict parses the
  nested last_known_state.controller), so they asserted against unparsed
  values. Rewrote both to the real nested payload and the values the
  model actually produces.

ruff check, black --check and pytest (79 passed) all pass locally.
@magikh0e magikh0e mentioned this pull request Jun 6, 2026
@bjhiltbrand bjhiltbrand merged commit 6fedd58 into bjhiltbrand:master Jun 6, 2026
11 checks passed
@magikh0e magikh0e deleted the fix-ci branch June 7, 2026 07:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants